import java.util.ArrayList;

public class FastEntryArry {
	private ArrayList<FastEntry> list;

	public FastEntryArry() {
		this.list = null;
	}

	public FastEntryArry(ArrayList<FastEntry> list) {
		super();
		this.list = list;
	}

	public <K> int search(K key) {
		for (int i = 0; i < this.list.size(); i++) {
			if (this.list.get(i).getKey() == key) {
				return i;
			}
		}
		return -1;

	}

	public void add(FastEntry entry) {
		this.list.add(entry);
	}

	
	public <K> boolean remove(K key) {
		int i = this.search(key);
		if (i < 0)
			return false;
		else
		{
			this.list.remove(i);
			return true;
		}
	}
	
	public <K> FastEntry retrieve(K key)
	{
		return this.list.get(search(key));
	}
			

}
